/**
 * Created by Dalyn on 2017/3/14.
 */
import React , {Component}from 'react';

import {Modal,Icon} from 'antd';
import "./css/create_order_three.css"

export default class BatchHint extends React.Component {
    constructor(props){
        super(props);
        this.state = {
            displayflag:false,
            text:""
        };
        this.deleteflag =false;
    }

    showWindow(displayflag,text,deleteflag) {
        this.setState({
            displayflag:displayflag,
            text:text
        });
        if (deleteflag === "delete")
            this.deleteflag = true;
    }

    onSure(){
        this.setState({
            displayflag:false
        });
        if (this.deleteflag){
            this.props._doDeleteProduct();
        }
    }
    handleCancel = () => {
        this.setState({
            displayflag: false,
        });
    }
    render(){
        return (
            <Modal className="batchhint_modal"
                   title="提示"
                   visible={this.state.displayflag}
                   onCancel={this.handleCancel}
                   onOk={this.onSure.bind(this)}
            >
                <p className="order_creat_hint_text">
                    <Icon type="exclamation-circle"  className="order_creat_warning"/>
                    <span className="order_creat_hint_word">{this.state.text}</span>
                </p>
            </Modal>
        )
    }
}